package com.netease.pkgRelated;

import protocol.XoneServiceCode;
import app.BaseApplication;

import com.netease.xone.R;

public class ErrorToString {
	public static String getString(int errCode){
		int errorStr;
		switch(errCode){
		case XoneServiceCode.TRANSACTION_SUCCESS:
			return null;
		case XoneServiceCode.TRANSACTION_FAIL:
    		errorStr = R.string.transaction_fail;
    		break;
    		
		case XoneServiceCode.NETWORK_ERR:
			errorStr = R.string.network_error;
			break;
		case XoneServiceCode.NETWORK_ERR_COMMON:
            errorStr = R.string.network_error_common;
            break;
		case XoneServiceCode.ERROR_CONTENT_NOTEXIST:
            errorStr = R.string.content_notexist;
            break;
		case XoneServiceCode.ERROR_ILLEGAL_CONTENT:
            errorStr = R.string.illegal_content;
            break;
		case XoneServiceCode.PROTOCOL_CODE_SEVER_ERROR:
		    errorStr = R.string.sever_err;
            break;
		default:
    		errorStr = R.string.unkown_err;
    		break;	
		}	
		return BaseApplication.getAppInstance().getResources().getString(errorStr);
	}
}
